package top.canyue.word_range_service.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import top.canyue.word_range.pojo.vo.WordDetailVo;

@Mapper
public interface WordDetailMapper {
    // 这样性能好
    @Select("SELECT word.word, difficulty_level, book_id, tran, example, example_tran, create_time, update_time " +
            "FROM word " +
            "JOIN word_mapping " +
            "ON word.word = word_mapping.word " +
            "WHERE word.word = #{word} AND book_id = #{bookId}")
    WordDetailVo getWordDetail(String word,String bookId);
}
